package dao

// 以下结构体就是用来接收被解析的配置文件中的配置信息的
type Autocode struct {
	Root             string `mapstructure:"root" json:"root" yaml:"root"`
	Server           string `mapstructure:"server" json:"server" yaml:"server"`
	ServerApi        string `mapstructure:"server-api" json:"serverApi" yaml:"server-api"`
	ServerInitialize string `mapstructure:"server-initialize" json:"serverInitialize" yaml:"server-initialize"`
	ServerModel      string `mapstructure:"server-model" json:"serverModel" yaml:"server-model"`
	ServerRequest    string `mapstructure:"server-request" json:"serverRequest"  yaml:"server-request"`
	ServerRouter     string `mapstructure:"server-router" json:"serverRouter" yaml:"server-router"`
	ServerService    string `mapstructure:"server-service" json:"serverService" yaml:"server-service"`
	Web              string `mapstructure:"web" json:"web" yaml:"web"`
	WebApi           string `mapstructure:"web-api" json:"webApi" yaml:"web-api"`
	WebForm          string `mapstructure:"web-form" json:"webForm" yaml:"web-form"`
	WebTable         string `mapstructure:"web-table" json:"webTable" yaml:"web-table"`
	WebFlow          string `mapstructure:"web-flow" json:"webFlow" yaml:"web-flow"`
}

type Captcha struct {
	KeyLong   int `mapstructure:"key-long" json:"keyLong" yaml:"key-long"`
	ImgWidth  int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"`
	ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"`
}

type Casbin struct {
	ModelPath string `mapstructure:"model-path" json:"modelPath" yaml:"model-path"`
}

type Email struct {
	To       string `mapstructure:"to" json:"to" yaml:"to"`       //邮件发送到哪里!(邮件的接收者)
	From     string `mapstructure:"from" json:"from" yaml:"from"` //邮件的发送源
	Host     string `mapstructure:"host" json:"host" yaml:"host"` //接收邮件的主机
	Port     int    `mapstructure:"port" json:"port" yaml:"port"` //接收邮件的端口
	IsSSL    bool   `mapstructure:"is-ssl" json:"isSSL" yaml:"is-ssl"`
	Secret   string `mapstructure:"secret" json:"secret" yaml:"secret"`       //邮件发送方的密钥
	Nickname string `mapstructure:"nickname" json:"nickname" yaml:"nickname"` //邮件发送方的昵称
}

type Excel struct {
	Dir string `mapstructure:"dir" json:"dir" yaml:"dir"`
}

type JWT struct {
	SigningKey  string `mapstructure:"signing-key" json:"signingKey" yaml:"signing-key"`
	ExpiresTime int64  `mapstructure:"expires-time" json:"expiresTime" yaml:"expires-time"`
	BufferTime  int64  `mapstructure:"buffer-time" json:"bufferTime" yaml:"buffer-time"`
}

type Local struct {
	Path string `mapstructure:"path" json:"path" yaml:"path" `
}

type Qiniu struct {
	Zone          string `mapstructure:"zone" json:"zone" yaml:"zone"`
	Bucket        string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
	ImgPath       string `mapstructure:"img-path" json:"imgPath" yaml:"img-path"`
	UseHTTPS      bool   `mapstructure:"use-https" json:"useHttps" yaml:"use-https"`
	AccessKey     string `mapstructure:"access-key" json:"accessKey" yaml:"access-key"`
	SecretKey     string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`
	UseCdnDomains bool   `mapstructure:"use-cdn-domains" json:"useCdnDomains" yaml:"use-cdn-domains"`
}

type Redis struct {
	DB       int    `mapstructure:"db" json:"db" yaml:"db"`
	Addr     string `mapstructure:"addr" json:"addr" yaml:"addr"`
	Password string `mapstructure:"password" json:"password" yaml:"password"`
}

type system struct {
	Env           string `mapstructure:"env" json:"env" yaml:"env"`
	Addr          int    `mapstructure:"addr" json:"addr" yaml:"addr"`
	DbType        string `mapstructure:"db-type" json:"dbType" yaml:"db-type"`
	OssType       string `mapstructure:"oss-type" json:"ossType" yaml:"oss-type"`
	UseMultipoint bool   `mapstructure:"use-multipoint" json:"useMultipoint" yaml:"use-multipoint"`
}

type TencentCOS struct {
	BaseURL    string `mapstructure:"base-url" json:"baseURL" yaml:"base-url"`
	Bucket     string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
	PathPrefix string `mapstructure:"path-prefix" json:"pathPrefix" yaml:"path-prefix"`
	Region     string `mapstructure:"region" json:"region" yaml:"region"`
	SecretID   string `mapstructure:"secret-id" json:"secretID" yaml:"secret-id"`
	SecretKey  string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`
}

type AliyunOSS struct {
	Endpoint        string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"`
	AccessKeyId     string `mapstructure:"access-key-id" json:"accessKeyId" yaml:"access-key-id"`
	AccessKeySecret string `mapstructure:"access-key-secret" json:"accessKeySecret" yaml:"access-key-secret"`
	BucketName      string `mapstructure:"bucket-name" json:"bucketName" yaml:"bucket-name"`
	BucketUrl       string `mapstructure:"bucket-url" json:"bucketUrl" yaml:"bucket-url"`
}

type Timer struct {
	Start  bool    `mapstructure:"start" json:"start" yaml:"start"`
	Spec   string  `mapstructure:"spec" json:"spec" yaml:"spec"`       //定时任务的名字
	Detail []Detail `mapstructure:"detail" json:"detail" yaml:"detail"` //具体的定时任务
}

// 具体定时任务
type Detail struct {
	TableName    string `mapstructure:"tableName" json:"tableName" yaml:"tableName"`
	CompareField string `mapstructure:"compareField" json:"compareField" yaml:"compareField"`
	Interval     string `mapstructure:"interval" json:"interval" yaml:"interval"`
}

type Zap struct {
	Level         string `mapstructure:"level" json:"level" yaml:"level"`
	Format        string `mapstructure:"format" json:"format" yaml:"format"`
	Prefix        string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
	Director      string `mapstructure:"director" json:"director"  yaml:"director"`
	LinkName      string `mapstructure:"link-name" json:"linkName" yaml:"link-name"`
	ShowLine      bool   `mapstructure:"show-line" json:"showLine" yaml:"showLine"`
	EncodeLevel   string `mapstructure:"encode-level" json:"encodeLevel" yaml:"encode-level"`
	StacktraceKey string `mapstructure:"stacktrace-key" json:"stacktraceKey" yaml:"stacktrace-key"`
	LogInConsole  bool   `mapstructure:"log-in-console" json:"logInConsole" yaml:"log-in-console"`
}

